<!-- BEGIN PAGE HEADER-->
<?php $this->load->view('partials/breadcrumb.tpl',  Array('_NO_IOSS_NEW'=>'1'))?>
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<script type="text/javascript">
function defConfirm(url){
	if(!confirm("确定要删除吗？")){
		return false;
	}
	window.location.href = url;
	return true;
}
$(document).ready(function(){
	$("#reset").click(function(){
		$("select").val('');
		$("input[type='text']").val('');
	});

	var registerUserCharts = function() {
        var chart = AmCharts.makeChart("chart_1", {
            "type": "serial",
            "theme": "light",
            "pathToImages": Metronic.getGlobalPluginsPath() + "amcharts/amcharts/images/",
            "autoMargins": false,
            "marginLeft": 30,
            "marginRight": 8,
            "marginTop": 10,
            "marginBottom": 26,

            "fontFamily": 'Open Sans',            
            "color":    '#888',
            
            "dataProvider": [
                <?php foreach ($list as $v):?>
                {
                    "cycle": <?=$v->cycle?>,
                    "registerNum": <?=$v->count?>,
                    "expenses": <?=$v->count?>
                },
                <?php endforeach;?>

            /*
            {
                "cycle": 2009,
                "registerNum": 23.5,
                "expenses": 18.1
			*/
            ],
            "valueAxes": [{
                "axisAlpha": 0,
                "position": "left"
            }],
            "startDuration": 1,
            "graphs": [{
                "alphaField": "alpha",
                "balloonText": "<span style='font-size:13px;'>[[title]] 在 [[category]]:<b>[[value]]</b> [[additional]]</span>",
                "dashLengthField": "dashLengthColumn",
                "fillAlphas": 1,
                "title": "注册人数",
                "type": "column",
                "valueField": "registerNum"
            }, {
                "balloonText": "<span style='font-size:13px;'>[[title]] 在 [[category]]:<b>[[value]]</b> [[additional]]</span>",
                "bullet": "round",
                "dashLengthField": "dashLengthLine",
                "lineThickness": 3,
                "bulletSize": 7,
                "bulletBorderAlpha": 1,
                "bulletColor": "#FFFFFF",
                "useLineColorForBulletBorder": true,
                "bulletBorderThickness": 3,
                "fillAlphas": 0,
                "lineAlpha": 1,
                "title": "期望注册人数",
                "valueField": "expenses"
            }],
            "categoryField": "cycle",
            "categoryAxis": {
                "gridPosition": "start",
                "axisAlpha": 0,
                "tickLength": 0
            }
        });

        $('#chart_1').closest('.portlet').find('.fullscreen').click(function() {
            chart.invalidateSize();
        });
    }

	registerUserCharts();
    
});
</script>
<div class="row">
	<div class="col-md-12">
		<!-- Begin: life time stats -->
		<div class="portlet">

			<?=form_open('', Array('class'=>'form-inline', 'role'=>'form'))?>
				<?=search_form_dropdown('status',Array(''=>'选择状态...', '1'=>'普通用户', '0'=>'禁用'),filterValue('status'),'状态', 'class="form-control input-medium"');?>
				<?=search_form_dropdown('cycle',Array(''=>'选择周期...', '1'=>'日', '2'=>'周','3'=>'月'),filterValue('cycle'),'周期', 'class="form-control input-medium"');?>
				<div class="input-group input-large date-picker input-daterange" data-date="" data-date-format="yyyy-mm-dd">
                	<input type="text" class="form-control" name="user_create_time_begin" value="<?=filterValue('user_create_time_begin')?>" placeholder="开始时间">
                    <span class="input-group-addon">to </span>
                    <input type="text" class="form-control" name="user_create_time_end" value="<?=filterValue('user_create_time_end')?>" placeholder="结束时间">
                </div>						
				<button type="button" class="btn default" id="reset">重置条件</button>
				<button type="submit" class="btn green about_search">搜索 <i class="fa fa-search"></i></button>
			<?=form_close()?>

			<div class="portlet-body">
				<!-- BEGIN ROW -->
				<div class="row" style="margin-top:20px;">
					<div class="col-md-12">
						<!-- BEGIN CHART PORTLET-->
						<div class="portlet light bordered">
							<div class="portlet-title">
								<div class="caption">
									<i class="icon-bar-chart font-green-haze"></i>
									<span class="caption-subject bold uppercase font-green-haze">注册用户统计报表</span>
									<span class="caption-helper">（请选择搜索栏内日、周、月统计方式和需要统计的时间段）</span>
								</div>
								<div class="tools">
									<a href="javascript:;" class="collapse">
									</a>
									<a href="#portlet-config" data-toggle="modal" class="config">
									</a>
									<a href="javascript:;" class="reload">
									</a>
									<a href="javascript:;" class="fullscreen">
									</a>
									<a href="javascript:;" class="remove">
									</a>
								</div>
							</div>
							<div class="portlet-body">
								<div id="chart_1" class="chart" style="height: 500px;">
								</div>
							</div>
						</div>
						<!-- END CHART PORTLET-->
					</div>
				</div>
				<!-- END ROW -->
			</div>
		</div>
		<!-- End: life time stats -->
	</div>
</div>

<!-- END PAGE CONTENT-->
